/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wwy
 * Date: 2024-11-10
 * Time: 19:11
 */
public class OverLoad {
    public static void main(String[] args) {
        add(1, 2); // 调用add(int, int)

        add(1, 2.5); // 调用add(double, double)

        add(1.5, 2.5, 3.5);  // 调用add(double, double, double)
        char[] a = new char[4];
        System.out.println(a[0]);
    }

    public static int add(int x, int y) {
        return x + y;
    }

    public static double add(int x, double y) {
        return x + y;
    }

    public static double add(double x, double y) {
        return x + y;
    }

    public static double add(double x, double y, double z) {
        return x + y + z;
    }

}
